.node-label {
  background-color: #e3f593d2;
  color: #000000;
  padding: 2px 5px;
  /* 强制一行显示 */
  white-space: nowrap;
  font-size: 14px;
}

/* 原有样式保持不变... */
.flow-editor {
  display: flex;
  height: 100%;
  width: 100%;
  font-family: Arial, sans-serif;
  outline: none;
  overflow: hidden;
}

.node-palette {
  background: #fff;
  border-right: 1px solid #e5e7eb;
  overflow: hidden;
  margin: 10px;
  padding: 10px;
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 5px;
}

.palette-node {
  margin: 5px 0;
  padding: 5px;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #f0f0f0;
  cursor: grab;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #ccc;
}

.palette-node:first-child {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: green;
}

.palette-node:active {
  cursor: grabbing;
}

.flow-canvas-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  margin: 10px;
  border-radius: 10px;
  background-color: #afafaf;
  position: relative;
  border: 1px solid #e5e7eb;
}

.flow-canvas {
  position: relative;
  transform-origin: 0 0;
  transition: transform 0.1s ease;
  background-size: 100% 100%;
}

.connections-container {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 5;
}

/* 允许连线被点击 */
.connection-line {
  pointer-events: auto !important;
}

.config-panel {
  flex: 0.2;
  background-color: #fff;
  margin: 10px;
  padding: 10px;
  border-radius: 5px;
  overflow: auto;
}

.config-panel p {
  margin-top: 8px;
}

.scale-control {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 999;
  background-color: #fff;
  border: 1px solid #e5e7eb;
  padding: 5px;
  width: auto;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}



.tc {
  font-size: 14px;
  cursor: pointer;
  color: #999;
  position: relative;
}

.tc .layer-list {
  position: absolute;
  top: 25px;
  left: -100px;
  background-color: #fff;
  width: 200px;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s ease;
  overflow: hidden;
}

.tc:hover .layer-list {
  transform: scaleY(1);
}

.czsm {
  font-size: 14px;
  cursor: pointer;
  color: #999;
  position: relative;
}

.czsm .layer-list {
  position: absolute;
  top: 25px;
  left: -100px;
  background-color: #fff;
  width: 200px;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s ease;
  overflow: hidden;
}

.czsm:hover .layer-list {
  transform: scaleY(1);
}

.scale-control button {
  padding: 5px 10px;
  cursor: pointer;
}

.flow-node {
  position: absolute;
  /* border: 1px solid #9ca3af; */
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: move;
  user-select: none;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.1s;
}

.flow-node.selected {
  border: 2px solid #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3) !important;
}

.connection-line.selected {
  stroke: #8a8a8a !important;
  stroke-width: 20 !important;
}

.flow-node.dragging {
  transform: scale(1.05);
  z-index: 20;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.flow-node.resizing {
  cursor: nwse-resize;
}

.flow-node.connection-source {
  box-shadow: 0 0 0 2px #3b82f6;
}

.selection-box {
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border: 2px dashed #3b82f6;
  pointer-events: none;
  z-index: 15;
}

.resize-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: #3b82f6;
  border: 1px solid white;
  z-index: 20;
  pointer-events: auto;
}

.resize-handle-se {
  right: -4px;
  bottom: -4px;
  cursor: nwse-resize;
}

.resize-handle-sw {
  left: -4px;
  bottom: -4px;
  cursor: nesw-resize;
}

.resize-handle-ne {
  right: -4px;
  top: -4px;
  cursor: nesw-resize;
}

.resize-handle-nw {
  left: -4px;
  top: -4px;
  cursor: nwse-resize;
}

.selection-box-area {
  position: absolute;
  background-color: rgba(59, 130, 246, 0.2);
  border: 1px dashed #3b82f6;
  pointer-events: none;
  z-index: 5;

  left: var(--box-x);
  top: var(--box-y);
  /* width: calc(abs(var(--box-width)));
  height: calc(abs(var(--box-height))); */
  width: var(--box-width);
  height: var(--box-height);
  transform: translateX(min(0, var(--box-width))) translateY(min(0, var(--box-height)));
}

/* 新增：对齐校准线样式 */
.alignment-guide {
  pointer-events: none;
  transition: opacity 0.1s ease;
}

.alignment-guide:hover {
  opacity: 0.8;
}

/* 图层 */
.liners {
  padding: 10px 15px;
  cursor: pointer;
  /* 不让复制 */
  user-select: none;
}
/* 添加连接线和控制点的样式 */
.connection-group {
  cursor: pointer;
}

.connection-group.selected .connection-line {
  stroke-width: 4;
  stroke: #000;
}

.connection-control-point {
  cursor: move;
  opacity: 0;
  transition: opacity 0.2s;
}

.connection-group.selected .connection-control-point {
  opacity: 1;
}

.connection-control-point:hover {
  r: 5;
  fill: #ff8a65;
}

.connection-preview {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { r: 5; }
  50% { r: 7; }
  100% { r: 5; }
}

/* 右键菜单样式 */
.context-menu {
  position: fixed;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  min-width: 120px;
  padding: 4px 0;
  font-size: 14px;
}

.context-menu-item {
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.2s;
  user-select: none;
}

.context-menu-item:hover {
  background-color: #f3f4f6;
}

.context-menu-divider {
  height: 1px;
  background-color: #e5e7eb;
  margin: 4px 0;
}

/* 自定义层级输入弹窗样式 */
.zindex-input-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1001;
}

.zindex-input-modal {
  background: white;
  border-radius: 8px;
  padding: 20px;
  min-width: 300px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.zindex-input-modal h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
  color: #333;
}

.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #666;
}

.button-group {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}